const Layout = () => import('../layout.vue')

export default [{
    path: '/reimbursementSetting',
    component: Layout,
    name: 'reimbursementSetting',
    meta: {
        title: '报账设置',
        icon: 'menu-menu_baozhang',
        noAuth: true,
        hidden: true,
       
    },
    redirect: '/businessType',
    children: [
        {
            path: 'businessType',
            name: 'businessType',
            component: () => import('@/views/businessType/index.vue'),
            meta: {
                title: '业务类型配置'
            },
            children: [
                {
                    path: 'addBusinessType',
                    name: 'addBusinessType',
                    component: () => import('@/views/businessType/addOrEdit/index.vue'),
                    meta: {
                        noAuth: true,
                        hidden: true,
                        title: '新增业务类型',
                        activeMenu: '/shared/businessType'
                    }
                },
                {
                    path: 'editBusinessType',
                    name: 'editBusinessType',
                    component: () => import('@/views/businessType/addOrEdit/index.vue'),
                    meta: {
                        noAuth: true,
                        hidden: true,
                        title: '编辑业务类型',
                        activeMenu: '/shared/businessType'
                    }
                }
            ]
        },
        {
            path: 'businessSubclass',
            name: 'businessSubclass',
            component: () => import('@/views/businessSubclass/index.vue'),
            meta: {
                title: '业务子类配置',
                cache: 'businessSubclass'
            }
        },
        {
            path: 'writeFormConfig',
            name: 'writeFormConfig',
            component: () => import('@/views/writeFormConfig/index.vue'),
            meta: {
                title: '填报类表单配置',
                cache: 'writeFormConfig'
            }
        },
        {
            path: 'noTaxTicketConfig',
            name: 'noTaxTicketConfig',
            component: () => import('@/views/noTaxTicketConfig/index.vue'),
            meta: {
                title: '不计税发票配置',
                cache: 'noTaxTicketConfig'
            }
        },
        {
            path: 'formHistory',
            name: 'formHistory',
            component: () => import('@/views/formHistory/index.vue'),
            meta: {
                title: '表单记录',
                cache: 'formHistory'
            }
        },
        {
            path: 'sortManagement/index',
            name: 'sortManagement',
            component: () => import('@/views/dataMaintenance/sortManagement/index.vue'),
            meta: {
                title: '分类字典配置',
                cache: 'sortManagement'
            }
        },
        {
            path: 'enumerationManagement/index',
            name: 'enumerationManagement',
            component: () => import('@/views/dataMaintenance/enumerationManagement/index.vue'),
            meta: {
                title: '枚举管理',
                cache: 'enumerationManagement'
            }
        },
        {
            path: 'ticketTaxConfig',
            name: 'ticketTaxConfig',
            component: () => import('@/views/ticketTaxConfig/index.vue'),
            meta: {
                title: '发票税率配置',
                cache: 'ticketTaxConfig'

            }
        },
        {
            path: 'ticketValidate',
            name: 'ticketValidate',
            component: () => import('@/views/ticketValidate/index.vue'),
            meta: {
                title: '发票验真开关'
            }
        },
        {
            path: 'feeConfig',
            name: 'feeConfig',
            meta: {
                title: '费用配置'
            },
            redirect: '/feeConfig/standardIndex',
            children: [
                {
                    path: 'standardIndex',
                    name: 'standardIndex',
                    component: () => import('@/views/feeConfig/standard/index.vue'),
                    meta: {
                        title: '费用标准',
                        catch: 'standardIndex'
                    },
                    children: [
                        {
                            path: 'standardAdd',
                            name: 'standardAdd',
                            component: () => import('@/views/feeConfig/standard/addOrEdit.vue'),
                            meta: {
                                title: '新增费用标准',
                                noAuth: true,
                                hidden: true,
                              
                            },
                        },
                        {
                            path: 'standardEdit',
                            name: 'standardEdit',
                            component: () => import('@/views/feeConfig/standard/addOrEdit.vue'),
                            meta: {
                                title: '编辑费用标准',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/feeConfig/standardIndex'
                            },
                        },
                        {
                            path: 'standardDetail',
                            name: 'standardDetail',
                            component: () => import('@/views/feeConfig/standard/detail.vue'),
                            meta: {
                                title: '费用标准详情',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/feeConfig/standardIndex'
                            },
                        }
                    ]
                },
                {
                    path: 'feeType',
                    name: 'feeType',
                    component: () => import('@/views/feeConfig/feeType/index.vue'),
                    meta: {
                        title: '费用类型',

                    },
                },
                {
                    path: 'dateType',
                    name: 'dateType',
                    component: () => import('@/views/feeConfig/dateType/index.vue'),
                    meta: {
                        title: '日期类型',
                        cache: 'dateType'

                    },
                },
                {
                    path: 'cityType',
                    name: 'cityType',
                    component: () => import('@/views/feeConfig/cityType/index.vue'),
                    meta: {
                        title: '城市类型',
                        cache: 'cityType'

                    },
                },
                {
                    path: 'cityManger',
                    name: 'cityManger',
                    component: () => import('@/views/feeConfig/cityManger/index.vue'),
                    meta: {
                        title: '城市管理',
                    },
                }
            ]
        },
        {
            path: 'budgetConfig',
            name: 'budgetConfig',
            meta: {
                title: '预算配置',

            },
            children: [
                {
                    path: 'budgetTemplate',
                    name: 'budgetTemplate',
                    component: () => import('@/views/budgetConfig/budgetTemplate.vue'),
                    meta: {
                        title: '预算模板',
                        cache: 'budgetTemplate'

                    },
                    children: [
                        {
                            path: 'budgetTemplateAdd',
                            name: 'budgetTemplateAdd',
                            component: () => import('@/views/budgetConfig/Common/templateAddOrEdit.vue'),
                            meta: {
                                title: '新增预算模板',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/budgetTemplate'

                            },
                        },
                        {
                            path: 'budgetTemplateEdit',
                            name: 'budgetTemplateEdit',
                            component: () => import('@/views/budgetConfig/Common/templateAddOrEdit.vue'),
                            meta: {
                                title: '编辑预算模板',
                                noAuth: true,
                                hidden: true,
                                activeMenu: 'shared/budgetConfig/budgetTemplate'
                            },
                        },
                        {
                            path: 'budgetTemplateLook',
                            name: 'budgetTemplateLook',
                            component: () => import('@/views/budgetConfig/Common/templateAddOrEdit.vue'),
                            meta: {
                                title: '查看预算模板',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/budgetTemplate'

                            },
                        }
                    ]

                },

                {
                    path: 'budgetSubject',
                    name: 'budgetSubject',
                    component: () => import('@/views/budgetConfig/budgetSubject.vue'),
                    meta: {
                        title: '预算科目',
                        cache: 'budgetSubject'

                    },
                },

                {
                    path: 'staffingPage',
                    name: 'staffingPage',
                    component: () => import('@/views/budgetConfig/budgetManger/staffing.vue'),
                    meta: {
                        title: '预算编制',

                    },
                    children: [

                        {
                            path: 'staffingEdit',
                            name: 'staffingEdit',
                            component: () => import('@/views/budgetConfig/budgetManger/Common/budgetEdit.vue'),
                            meta: {
                                title: '预算编辑',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/staffingPage'
                            },
                        }
                    ]
                },
                {
                    path: 'budgetQuery',
                    name: 'budgetQuery',
                    component: () => import('@/views/budgetConfig/budgetQuery/index.vue'),
                    meta: {
                        title: '预算查询',
                        cache: 'budgetQuery'
                    },
                    children: [

                        {
                            path: 'budgetClearOrder',
                            name: 'budgetClearOrder',
                            component: () => import('@/views/budgetConfig/budgetQuery/changeDetail.vue'),
                            meta: {
                                title: '预算明细-单据清单',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/budgetQuery',
                                type: 'USE'
                            },
                        },
                        {
                            path: 'budgetChangeDetail',
                            name: 'budgetChangeDetail',
                            component: () => import('@/views/budgetConfig/budgetQuery/changeDetail.vue'),
                            meta: {
                                title: '预算明细-调整明细',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/budgetQuery',
                                type: 'ADJUSTMENT'
                            },
                        },
                        {
                            path: 'staffingEdit',
                            name: 'staffingEdit',
                            component: () => import('@/views/budgetConfig/budgetManger/Common/budgetEdit.vue'),
                            meta: {
                                title: '预算编辑',
                                noAuth: true,
                                hidden: true,
                                activeMenu: '/shared/budgetConfig/staffingPage'
                            },
                        }

                    ]
                },
                {
                    path: 'userSetting',
                    name: 'userSetting',
                    component: () => import('@/views/budgetConfig/userSetting/index.vue'),
                    meta: {
                        title: '预算查询权限',
                        cache: 'userSetting'
                    }
                }
            ]
        },
        {
            path: 'costCenterConfig',
            name: 'costCenterConfig',
            component: () => import('@/views/costCenterConfig/index.vue'),
            meta: {
                title: '成本中心配置'
            }
        },
        {
            path: 'depCostCenterConfig',
            name: 'depCostCenterConfig',
            component: () => import('@/views/depCostCenterConfig/index.vue'),
            meta: {
                title: '部门对应成本中心配置'
            }
        },
        {
            path: 'flowTemplateConfig',
            name: 'flowTemplateConfig',
            component: () => import('@/views/flowTemplateConfig/flowTemplateConfig.vue'),
            meta: {
                title: '流程模板配置',
                cache: 'flowTemplateConfig'
            },
            children: [
                {
                    path: 'referenceDetail',
                    name: 'referenceDetail',
                    component: () => import('@/views/flowTemplateConfig/referenceDetail.vue'),
                    meta: {
                        noAuth: true,
                        hidden: true,
                        title: '引用详情',
                        activeMenu: '/shared/flowTemplateConfig'
                    }
                }
            ]
        },
        {
            path: 'invoiceStatistics',
            name: 'invoiceStatistics',
            component: () => import('@/views/invoiceStatistics/index.vue'),
            meta: {
                title: '发票报账统计',
                cache: 'invoiceStatistics'
            }
        },
        {
            path: 'related-transaction',
            name: 'RelatedTransaction',
            component: () => import('@/views/related-transaction/index.vue'),
            meta: {
                title: '关联交易配置'
            },
            children: [
                {
                    path: 'transaction-project/:type/:id',
                    name: 'TransactionProject',
                    component: () => import('@/views/related-transaction/transaction-project.vue'),
                    meta: {
                        noAuth: true,
                        hidden: true,
                        title: '关联交易项目',
                        activeMenu: '/shared/related-transaction'
                    },
                    beforeEnter(to, from, next) {
                        const routeParams = to.params
                        const title = { edit: '编辑', view: '查看' }[routeParams.type] + '关联交易项目'
                        to.meta.title = title
                        let index = (to.meta.breadcrumbNeste || []).findIndex((item) => item.path.indexOf('/:type/:id') > -1)
                        if (index > -1) {
                            to.meta.breadcrumbNeste[index].title = title
                        }
                        next()
                    }
                }
            ]
        },
    ]
}
]